﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CsvInput.aspx.cs" Inherits="main_comm_CsvUpload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link href="../../css/cde.css" rel="stylesheet" type="text/css" />
    <title><asp:Literal id="title" runat="server" Text="<%$Resources:ResourceAdmin,CSV_INPUT%>"></asp:Literal></title>
     <script charset="utf-8" language="javascript" type="text/javascript">
        function chkCsv()
        {
            var fileObj = document.getElementById("fileUpload");
	        var path = fileObj.value;
	        var type = path.substr(path.lastIndexOf("."));
            var types = ".csv.CSV";
            if(path == "" || path == null)
            {
                alert(document.getElementById("hiddSelectMsg").value);
                return false;
            }
	        else if (types.indexOf(type) == -1) {
	           alert(document.getElementById("hiddCheckMsg").value);
	           fileObj.value = null;
	           return false;
	        }
	        else
	        {
	            return true;
	        }
        }
     </script>
</head>
<body style ="background-color:#F7F8FB">
    <form id="form1" runat="server">
    <div>
     <div align="center" class="titleblue"><asp:Literal id="Literal1" runat="server" Text="<%$Resources:ResourceAdmin,CSV_INPUT%>"></asp:Literal></div>
        <table align="center" class="tbl1" cellspacing="0" id="dgProperties" style="border-width:0px;border-collapse:collapse;">
         <tr>
            <td colspan="2">
            &nbsp;
            </td>
        </tr>
        <tr>
              <th class="blue" align="right">
                <asp:label runat="server" ID="lblName" Text="<%$Resources:ResourceAdmin,CSV_INPUT %>" ForeColor="#37385A"></asp:label>
              </th>
              <td class="blue" align="left">
                <asp:FileUpload ID="fileUpload" runat="server" />
              </td>
         </tr>
         <tr>
            <td colspan="2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
            <asp:Button name="cmdCsvInput" runat="server" Text="<%$Resources:ResourceAdmin,CSV_INPUT %>" id="cmdCsvInput" class="commandDBtn" onmouseenter="document.all('cmdCsvInput').className = 'commandSBtn';" onmouseleave="document.all('cmdCsvInput').className = 'commandDBtn';" OnClick="cmdCsvInput_Click" OnClientClick="return chkCsv()"/> &nbsp;
            <asp:Button name="cmdClose" id="cmdClose" class="commandDBtn" onmouseenter="document.all('cmdClose').className = 'commandSBtn';" onmouseleave="document.all('cmdClose').className = 'commandDBtn';" runat="server" Text="<%$Resources:Resource,BTN_CLOSE %>" OnClientClick="window.close()"/>
            </td>
          </tr>         
        </table>
          <asp:HiddenField ID="hiddCheckMsg" runat="server" value="<%$Resources:ResourceAdmin,CSV_TYPE %>"/>
         <asp:HiddenField ID="hiddSelectMsg" runat="server" value="<%$Resources:ResourceAdmin,CSV_TYPE_SELECT %>"/>
    </div>
    </form>
</body>
</html>
